//@version=5
indicator("WinOptionCrypto Triple EMA Strategy", overlay=true, timeframe="")

ema15 = ta.ema(close, 15)
ema30 = ta.ema(close, 30)
ema60 = ta.ema(close, 60)

plot(ema15, "EMA 15", color=color.blue, linewidth=2)
plot(ema30, "EMA 30", color=color.green, linewidth=2)
plot(ema60, "EMA 60", color=color.red, linewidth=2)

length = 2
smoothK = 3
smoothD = 3
k = ta.sma(ta.stoch(close, high, low, length), smoothK)
d = ta.sma(k, smoothD)

buyCondition = close > ema15 and ema15 > ema30 and ema30 > ema60 and close[1] < ema15[1] and close[1] > ema60[1] and k > d and k < 80

sellCondition = close < ema15 and ema15 < ema30 and ema30 < ema60 and close[1] > ema15[1] and close[1] < ema60[1] and k < d and k > 20

plotshape(buyCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.normal)
plotshape(sellCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.normal)